package com.okx.bot.service;

import cn.hutool.http.HttpUtil;
import org.springframework.stereotype.Service;

@Service
public class OkxApiClient {
    private static final String OKX_API_BASE_URL = "https://www.okx.com/api/v5/";

    public String getAllProd() {
        String url = OKX_API_BASE_URL + "public/instruments?instType=SWAP";
        return HttpUtil.get(url);
    }

    public String getLineData(String instId, String bar, int limit) {
        String url = OKX_API_BASE_URL + "market/candles?instId=" + instId + "&bar=" + bar + "&limit=" + limit;
        return HttpUtil.get(url);
    }
}